package com.thb.pay.manage.web.agent;

import com.thb.pay.api.agent.AgentAccountHistoryServiceApi;
import com.thb.pay.api.agent.vo.req.AgentAccountHistoryPageReq;
import com.thb.pay.api.agent.vo.resp.AgentAccountHistoryVo;
import com.thb.pay.core.utils.PageResult;
import com.thb.pay.core.utils.R;
import com.thb.pay.manage.comm.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @类名称 AgentAccountHistoryController
 * @类描述 <pre>代理商资金流水控制类</pre>
 * @作者 lucky
 * @创建时间 2019/10/12
 * @版本 v1.01
 * </pre>
 */
@RestController
@RequestMapping("/api/sys/agentAccountHistory")
public class AgentAccountHistoryController extends BaseController {

    @Autowired
    private AgentAccountHistoryServiceApi agentAccountHistoryServiceApi;

    /**
     * 查询资金流水列表
     *
     * @return
     */
    @PostMapping("/list")
    public R list(@RequestBody AgentAccountHistoryPageReq pageReq) {
        PageResult<AgentAccountHistoryVo> pageResult = agentAccountHistoryServiceApi.findPage(pageReq);
        return R.ok(pageResult);
    }

    /**
     * 查询资金流水
     *
     * @return
     */
    @GetMapping("/get")
    public R get(@RequestParam("id") Long id) {
        return R.ok(agentAccountHistoryServiceApi.getById(id));
    }
}
